import Vue from 'vue';
 
const disPrevent= Vue.directive('disPrevent', {
  inserted: function(el, binding) {
    el.addEventListener('click', () => {
      if (!el.disabled) {
        el.disabled = true;
        setTimeout(() => {
          el.disabled = false;
        }, binding.value || 2000);
      }
    });
  }
});
 
export { disPrevent};